import request from "@/utils/request";

/**
 * 读取所有菜单
 * @param {父级菜单 id} id
 */
export function read() {
  return request({
    url: "/api/menu",
    method: "get"
  });
}

/**
 * 获取菜单详细信息
 * @param {菜单id} id
 */
export function load(id) {
  return request({
    url: "/api/menu/" + id,
    method: "get"
  });
}

/**
 * 更新系统用户
 * @param {新用户模型} param
 */
export function update(param) {
  return request({
    url: "/api/menu",
    method: "post",
    data: param,
    headers: { "Content-Type": "application/json" }
  });
}

/**
 * 删除系统用户
 * @param {用户 id} id
 */
export function destroy(id) {
  return request({
    url: "/api/menu/" + id,
    method: "delete",
    headers: { "Content-Type": "application/json" }
  });
}
